STEP 1: Notice that we set the stage and started a main function. Let's build a function that'll ask users a question.

  • This function will need two parameters: the sprite asking the question and the question we'll ask the user.
  • In LOGIC and , drag Define Function with Docstring above where it says: MAIN FUNCTION.
  • Rename my_function to ask_user_question and type sprite, question inside the ( ).
  • Finally, change your docstring to the following: """ Asks user a question and returns result """

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)